package com.xinsoft.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinsoft.common.BaseEntity;
import com.xinsoft.entity.po.ScmPurchaseItem;
import com.xinsoft.entity.po.ScmPurchasePlanItem;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 采购计划
 * @TableName scm_purchase
 */
@Data
public class ScmPurchasePlanDto extends BaseEntity {

    /**
     * 单据类型
     */
    private Integer purchasePlanType;

    /**
     * 采购编码 10745
     */
    private String purchasePlanCode;

    /**
     * 公司/供应商
     */
    private Integer supplierId;

    /**
     * 申请人ID
     */
    private Integer applyPersonId;

    /**
     * 关闭状态（0未关闭，1关闭）
     */
    private Integer doClose;

    /**
     * 申请时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date applyTime;

    /**
     * 预交时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date planEndTime;

    /**
     * 采购计划状态   默认0暂存, 1:已提交(审批中), 2:驳回, 3:审核通过
     */
    private Integer purchasePlanStatus;

    /**
     * 备注
     */
    private String remarks;

    private static final long serialVersionUID = 1L;

    @Valid
    @NotNull(message = "计划详情不能为空！")
    private List<ScmPurchasePlanItem> itemList;
}